ASP.NET MVC Core default layout page not loading if I navigate to any razor page in Identity area e.g login, register etc

您所在的位置:网站首页 aspnet login page example with remember ASP.NET MVC Core default layout page not loading if I navigate to any razor page in Identity area e.g login, register etc

ASP.NET MVC Core default layout page not loading if I navigate to any razor page in Identity area e.g login, register etc

2023-05-05 02:05| 来源: 网络整理| 查看: 265

I am currently working on an ** MVC Core project using .Net8 preview**. Everything on the project works fine except the pages included after scaffolding identity. i.e Login, Register etc. When I navigate to login\Register page for example, the default layout of my app doesn't load. Meaning my navbar and footer is not displayed. Instead a blank navbar is displayed with nothing but the project name and Login/Register button at top. But on all the razor views everything works find.

What I have also noticed is that if I try to edit the Login.cshtml page, the changes doesn't reflect on the UI. (Not related to HotReload). Even if I clean, rebuild or restart visual studio, the changes don't reflect when login page is loaded. For example I modified this simple h2 on login.cshtml

From

Use223 a local account to log in.

To

Use223 a local account to log in.

Nothing happens. I don't know if the Account pages are being loaded from another location other than the folders in my project.

I have tried scaffolding identity several times from several previous versions of the project, and end up with same issue.

I have mapped razor pages in Program.cs file _ I have correctly specify the layout page in ViewStart file inside Accounts folder

@{ Layout = "~/Views/Shared/_Layout.cshtml"; }



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3